package com.xlh.dto.conclude;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author cfz
 */
@Data
@ApiModel(" 添加达成度目标DTO ")
@Accessors(chain = true)
public class ConcludeDTO {

    @ApiModelProperty("主键值")
    private Long id;

    @ApiModelProperty("课程ID")
    @NotNull(message = "课程ID不能为null")
    private Long courseId;

    @Length(max = 15, message = "请正确填写行业名称，最多可输入20字符")
    @NotBlank(message = "课程名称不能为空")
    @ApiModelProperty("达成度名称")
    private String name;

    @ApiModelProperty("负责人名称")
    @NotBlank(message = "负责人名称不能为空")
    private String principal;

    @ApiModelProperty("阈值")
    @Range(min = 1, max = 100, message = "阈值必须在1~100之间")
    private BigDecimal thresholdValue;

    @ApiModelProperty("是否公布")
    private Boolean isPublish;

    @ApiModelProperty("图标Key值")
    private String iconValue;


    public void init(){
        thresholdValue = new BigDecimal("100");
    }
    public void clearId() {
        this.setId(null);
    }
}
